function diff = delta_fun(m,param)
    % delta(m) function
    if param.K == 0 
        diff=param.lambda.*param.s.*(m<param.m_h) ...
            +(m>=param.m_h).*(m<param.m_u).*delta_OJS(m,param)...
            +(m>=param.m_u).*0;
    else
        diff=param.lambda.*param.s.*(m<param.m_h) ...
            +(m>=param.m_h).*(m<param.m_e).*delta_m(m,param) ...
            +(m>=param.m_e).*(m<param.m_u).*delta_u(m,param) ...
            +(m>=param.m_u).*0;
    end

end